
<template tag="以下文档内容为hycli自动生成">
  <div>
   
    <!-- 归类 -->
    <el-dialog v-model="conf.aaaqh_visible" 
        draggable
      title="归类" :close-on-click-modal="false"  width="60%"
      top="10vh" 
      :before-close="hide_aaaqh">
    <el-form  ref="fm_aaaqh" :model="form_aaaqh" :rules="rules_aaaqh">
    <el-row>
    <el-col :span="24">
    <!-- {"index":17,"raw":"category","name":"category","cname":"Category","type":{"raw":"varchar2(64)","name":"varchar2","len":64,"dlen":0},"defValue":"","allowNull":true,"constraints":["l","le","sl(tsk_category)","w","q","v","w","tp(radio,w)","tp(tag,l)","tp(multiselect,q)"],"desc":{"raw":"分类","name":"分类"}} -->
    <el-form-item prop="category" label="分类" label-width="100px" label-position="right">
      <el-radio-group v-model="form_aaaqh.category"   >
        <el-radio-button v-for="item in categoryList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    </el-row>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="hide_aaaqh" icon="close">取消</el-button>
        <el-button type="primary" @click="save_aaaqh" icon="select">提交</el-button>
      </span>
    </template>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data(){
    return{
      conf:{
        aaaqh_visible:false,//归类
      },
      form_aaaqh:{},//归类
      //归类
      rules_aaaqh:{ 
        category:[{required:false, message:"请输入分类", trigger: 'blur'}],
      },
    }
  },
  methods:{
     //--------------------归类---------------------------------
      //显示 归类 弹出框
      show_aaaqh(fm){
        //处理输入参数
        let currentForm = {}
        Object.assign(this.form_aaaqh,currentForm)
        this.form_aaaqh.category = fm.category
        this.form_aaaqh.daily_id = fm.daily_id
        //特殊参数处理
        // this.form_aaaqh.daily_id = (this.bcheck||[]).join(",")
        this.loadEnums_aaaqh()
        this.conf.aaaqh_visible = true;
      },

      //隐藏 归类 弹出框
      hide_aaaqh(){
        this.conf.aaaqh_visible = false;
        this.$refs.fm_aaaqh.resetFields();
      },

      //保存 归类 弹出框数据
      save_aaaqh(){
        let that = this
        this.$refs.fm_aaaqh.validate((v=>{
          if(!v) return
          let post_form_aaaqh = this.form_aaaqh
          this.$theia.http.post("/ws/daily/task/category",post_form_aaaqh).then(res=>{
            that.$notify.success({title: '成功',message: '提交成功',duration:5000})
            that.$emit("onsaved")
            that.hide_aaaqh()
          }).catch(res=>{
            let code = ((res||{}).response||{}).status||0
            let msg= `提交失败(${code})`
            that.$notify.error({title: '失败',message:msg,duration:5000})
          })
      }))
    },
    //归类
    loadEnums_aaaqh(){
        //分类
        this.categoryList = this.$theia.enum.get("tsk_category","","" ,false,"")
    },

  },
}
</script>
<style scoped>
.form_item_info{
  margin-left: 4px;
  color:#999;
}
.form_item_info:hover{
  cursor: pointer;
  font-weight: 500;
  color:#333;
}
</style>